package com.nbufe.command.demo3;

/**
 * @Author Zan
 * @Create 2024/6/12 14:36
 * @ClassName: SubtractCommand
 * @Description : TODO 请用一句话描述该类的功能
 */
public class SubtractCommand extends AbstractCommand {

    private Subtract subtract = new Subtract();

    private int value;

    @Override
    public double compute(int value) {
        this.value = value;
        return subtract.sub(value);
    }

    @Override
    public double revoke() {
        return subtract.sub(-value);
    }

    @Override
    public double resume() {
        return subtract.sub(value);
    }
}
